## 结构体编辑模版
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/s/js/prototype.js"></script>
<script type="text/javascript" src="/s/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">

function GenSyntax()
{
    params = \$F('textarea_src');
    params = params.gsub(/\t/, '');
    params = params.gsub(/\r\n/, '\n');
    params = params.gsub(/(.*) (.*?);/, function(match){if (match[1].strip() == "}") return match[1] + match[2] + ';'; else return '    [[' + match[1].strip() + ']] ' + match[2] + ';';});

    \$('textarea_syntax').value = params;
}

function GenParam()
{
    params = \$F('textarea_src');
    params = params.gsub(/.*{|}.*/, '');
    params = params.gsub(/.*? (.*?);/, '<dt>#{1}</dt><dd><p>[in] </p></dd>');
    
    
    if (!params.blank())
        tinyMCE.getInstanceById('textarea_parameters').setHTML("<dl>"+params+"</dl>");
}

function GenAll()
{
    GenSyntax();
    GenParam();
}

function VerifyData()
{
    if (tinyMCE.getInstanceById('textarea_parameters').getHTML() == '')
        tinyMCE._getElementById('textarea_parameters').disabled = true;
    if (tinyMCE.getInstanceById('textarea_desc').getHTML() == '')
        tinyMCE._getElementById('textarea_desc').disabled = true;
    if (tinyMCE.getInstanceById('textarea_remarks').getHTML() == '')
        tinyMCE._getElementById('textarea_remarks').disabled = true;

    if (\$F('textarea_syntax') == '')
        \$('textarea_syntax').disabled = true;
    if (\$F('textarea_requirements') == '')
        \$('textarea_requirements').disabled = true;
    if (\$F('textarea_see_also') == '')
        \$('textarea_see_also').disabled = true;
        
    return true;
}

Event.observe(window, 'load', function() {
    Event.observe('genall', 'click', GenAll);
    Event.observe('gensyntax', 'click', GenSyntax);
    Event.observe('genparam', 'click', GenParam);
    Event.observe('formdoc', 'submit', VerifyData);
});

</script>

<title>$c_mark_title</title>
</head>

<body>

<p>Source Generator:</p>
<textarea name="src" cols="100" rows="10" id="textarea_src"></textarea><br>
<input type="submit" value="生成代码和参数" id="genall" />
<input type="submit" value="生成代码" id="gensyntax" />
<input type="submit" value="生成参数" id="genparam" />


<form id="formdoc" name="formdoc" method="post" action="$c_mark_action">
<p>Parameters:</p>
<p>
  <textarea name="parameters" cols="100" rows="10" id="textarea_parameters">$getVar('parameters', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>Description:</p>
<p>
  <textarea name="desc" cols="100" rows="10" id="textarea_desc">$getVar('desc', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>Syntax:</p>
<p>
  <textarea name="syntax" cols="100" rows="10" id="textarea_syntax">$getVar('syntax', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>Remarks:</p>
<p>
  <textarea name="remarks" cols="100" rows="10" id="textarea_remarks">$getVar('remarks', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>Requirements:</p>
<p>
  <textarea name="requirements" cols="100" rows="10" id="textarea_requirements">$getVar('requirements', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>See Also:</p>
<p>
  <textarea name="seealso" cols="100" rows="10" id="textarea_see_also">$getVar('seealso', '')</textarea>
  <input type="submit" value="Submit" id="Submit" />
</p>

<p>
    <input type="submit" value="Submit" id="Submit" />
</p>
</form>

<script type="text/javascript">

tinyMCE.init({
    mode : "exact",
    elements : "textarea_parameters, textarea_desc, textarea_example2, textarea_remarks",
    theme : "advanced",
    plugins : "paste, table",
    language :"zh_cn_utf8",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator, styleselect,formatselect,separator, bullist,numlist,separator, hr,link,unlink,image,separator, code,separator",
    theme_advanced_buttons1_add : "tablecontrols",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    button_tile_map : true,
    relative_urls : true,
    remove_script_host : false,
    theme_advanced_path_location : "bottom",
    theme_advanced_resizing : true,
    content_css : "/s/css/api_simple.css",
    editor_css : "/s/css/tinymce_ui.css",
    popups_css_add : "/s/css/tinymce_popup.css",
    paste_use_dialog : false,
    paste_auto_cleanup_on_paste : true,
    paste_convert_headers_to_strong : false,
    paste_strip_class_attributes : "all",
    paste_remove_spans : true,
    paste_remove_styles : true,
    cleanup : true,
    remove_linebreaks : false,
    theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,pre,blockquote,code,var,tt"
});

</script>

</body>
</html>